<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Luat开源项目脚本lib</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>script_LuaTask lib</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Functions">Functions</a></li>
<li><a href="#Fields">Fields</a></li>
</ul>


<h2>Modules</h2>
<ul class="nowrap">
  <li><a href="../modules/aLiYun.html">aLiYun</a></li>
  <li><a href="../modules/aLiYunOta.html">aLiYunOta</a></li>
  <li><a href="../modules/agps.html">agps</a></li>
  <li><a href="../modules/agpsHxxt.html">agpsHxxt</a></li>
  <li><a href="../modules/agpsZkw.html">agpsZkw</a></li>
  <li><a href="../modules/audio.html">audio</a></li>
  <li><a href="../modules/cc.html">cc</a></li>
  <li><a href="../modules/clib.html">clib</a></li>
  <li><a href="../modules/common.html">common</a></li>
  <li><a href="../modules/console.html">console</a></li>
  <li><a href="../modules/errDump.html">errDump</a></li>
  <li><strong>ftp</strong></li>
  <li><a href="../modules/gps.html">gps</a></li>
  <li><a href="../modules/gpsHxxt.html">gpsHxxt</a></li>
  <li><a href="../modules/gpsZkw.html">gpsZkw</a></li>
  <li><a href="../modules/http.html">http</a></li>
  <li><a href="../modules/lbsLoc.html">lbsLoc</a></li>
  <li><a href="../modules/led.html">led</a></li>
  <li><a href="../modules/link.html">link</a></li>
  <li><a href="../modules/log.html">log</a></li>
  <li><a href="../modules/misc.html">misc</a></li>
  <li><a href="../modules/mqtt.html">mqtt</a></li>
  <li><a href="../modules/net.html">net</a></li>
  <li><a href="../modules/netLed.html">netLed</a></li>
  <li><a href="../modules/ntp.html">ntp</a></li>
  <li><a href="../modules/nvm.html">nvm</a></li>
  <li><a href="../modules/patch.html">patch</a></li>
  <li><a href="../modules/pb.html">pb</a></li>
  <li><a href="../modules/pins.html">pins</a></li>
  <li><a href="../modules/pm.html">pm</a></li>
  <li><a href="../modules/powerKey.html">powerKey</a></li>
  <li><a href="../modules/record.html">record</a></li>
  <li><a href="../modules/ril.html">ril</a></li>
  <li><a href="../modules/scanCode.html">scanCode</a></li>
  <li><a href="../modules/sim.html">sim</a></li>
  <li><a href="../modules/sms.html">sms</a></li>
  <li><a href="../modules/socket.html">socket</a></li>
  <li><a href="../modules/sys.html">sys</a></li>
  <li><a href="../modules/uiWin.html">uiWin</a></li>
  <li><a href="../modules/update.html">update</a></li>
  <li><a href="../modules/utils.html">utils</a></li>
  <li><a href="../modules/websocket.html">websocket</a></li>
  <li><a href="../modules/wifiScan.html">wifiScan</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>ftp</code></h1>
<p>模块功能：FTP客户端</p>
<p></p>
    <h3>Info:</h3>
    <ul>
        <li><strong>Copyright</strong>: OpenLuat.com</li>
        <li><strong>Release</strong>: 2020.12.08</li>
        <li><strong>License</strong>: MIT</li>
        <li><strong>Author</strong>: Dozingfiretruck</li>
    </ul>


<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#close">
    close ()
    </a></td>
	<td class="summary">FTP客户端关闭</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#command">
    command (command, timeout)
    </a></td>
	<td class="summary">FTP客户端命令</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#login">
    login (ftp_mode, host, port, username, password, timeout, ssl, cert)
    </a></td>
	<td class="summary">FTP客户端登录</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#upload">
    upload (remote_file, local_file, timeout)
    </a></td>
	<td class="summary">FTP客户端文件上传</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#download">
    download (remote_file, local_file, timeout)
    </a></td>
	<td class="summary">FTP客户端文件下载</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#checktype">
    checktype (mode, timeout)
    </a></td>
	<td class="summary">设置FTP传输类型 A:ascii I:Binary</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#pwd">
    pwd (timeout)
    </a></td>
	<td class="summary">显示当前工作目录</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#cwd">
    cwd (path, timeout)
    </a></td>
	<td class="summary">更改工作目录</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#cdup">
    cdup (timeout)
    </a></td>
	<td class="summary">回到上级目录</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#mkd">
    mkd (path, timeout)
    </a></td>
	<td class="summary">创建目录</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#list">
    list (file_irectory, timeout)
    </a></td>
	<td class="summary">列出目录列表或文件信息</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#deletefolder">
    deletefolder (file_irectory, timeout)
    </a></td>
	<td class="summary">删除目录</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#deletefile">
    deletefile (file_irectory, timeout)
    </a></td>
	<td class="summary">删除文件</td>
	</tr>
</table>
<h2><a href="#Fields">Fields</a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#ftp_data_client">
    ftp_data_client
    </a></td>
	<td class="summary">创建ftp数据连接</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#ftp_client">
    ftp_client
    </a></td>
	<td class="summary">创建ftp命令连接</td>
	</tr>
</table>

<br/>
<br/>


    <h2 class="section-header "><a name="Functions"></a>Functions</h2>

    <dl class="function">
    <dt>
    <a name = "close"></a>
    <strong  style="color: red;">
    close ()
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">FTP客户端关闭</pre>







</dd>
    <dt>
    <a name = "command"></a>
    <strong  style="color: red;">
    command (command, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">FTP客户端命令</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">command</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,命令 例如"PWD" "HELP LIST" "SYST"</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "login"></a>
    <strong  style="color: red;">
    login (ftp_mode, host, port, username, password, timeout, ssl, cert)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">FTP客户端登录</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">ftp_mode</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,FTP模式"PASV" or "PORT"  默认PASV:被动模式,PORT:主动模式 (暂时仅支持被动模式)</pre>
        </li>
        <li><span class="parameter">host</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,ip地址</pre>
        </li>
        <li><span class="parameter">port</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">number类型,端口,默认21</pre>
        </li>
        <li><span class="parameter">username</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,用户名</pre>
        </li>
        <li><span class="parameter">password</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,密码</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
        <li><span class="parameter">ssl</span>
            <span class="types"><span class="type">bool</span></span>
        <pre class="example">可选参数，默认为nil，ssl，是否为ssl连接，true表示是，其余表示否</pre>
        </li>
        <li><span class="parameter">cert</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.5">table</a></span>
        <pre class="example">可选参数，默认为nil，cert，ssl连接需要的证书配置，只有ssl参数为true时，才参数才有意义，cert格式如下：
     {
     caCert = "ca.crt", --CA证书文件(Base64编码 X.509格式)，如果存在此参数，则表示客户端会对服务器的证书进行校验；不存在则不校验
     clientCert = "client.crt", --客户端证书文件(Base64编码 X.509格式)，服务器对客户端的证书进行校验时会用到此参数
     clientKey = "client.key", --客户端私钥文件(Base64编码 X.509格式)
     clientPassword = "123456", --客户端证书文件密码[可选]
     }</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "upload"></a>
    <strong  style="color: red;">
    upload (remote_file, local_file, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">FTP客户端文件上传</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">remote_file</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,远程文件名</pre>
        </li>
        <li><span class="parameter">local_file</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,本地文件名</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "download"></a>
    <strong  style="color: red;">
    download (remote_file, local_file, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">FTP客户端文件下载</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">remote_file</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,远程文件名</pre>
        </li>
        <li><span class="parameter">local_file</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,本地文件名</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "checktype"></a>
    <strong  style="color: red;">
    checktype (mode, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">设置FTP传输类型 A:ascii I:Binary</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">mode</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">A:ascii I:Binary</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "pwd"></a>
    <strong  style="color: red;">
    pwd (timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">显示当前工作目录</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "cwd"></a>
    <strong  style="color: red;">
    cwd (path, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">更改工作目录</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">path</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">工作目录</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "cdup"></a>
    <strong  style="color: red;">
    cdup (timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">回到上级目录</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "mkd"></a>
    <strong  style="color: red;">
    mkd (path, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">创建目录</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">path</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">目录</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "list"></a>
    <strong  style="color: red;">
    list (file_irectory, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">列出目录列表或文件信息</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">file_irectory</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">目录或文件</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "deletefolder"></a>
    <strong  style="color: red;">
    deletefolder (file_irectory, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">删除目录</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">file_irectory</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,路径目录</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
    <dt>
    <a name = "deletefile"></a>
    <strong  style="color: red;">
    deletefile (file_irectory, timeout)
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">删除文件</pre>


    <h3>Parameters:</h3>
    <ul>
        <li><span class="parameter">file_irectory</span>
            <span class="types"><a class="type" href="https://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
        <pre class="example">string类型,路径文件(相对/绝对)</pre>
        </li>
        <li><span class="parameter">timeout</span>
            <span class="types"><span class="type">number</span></span>
        <pre class="example">number类型,可选参数，接收超时时间，单位毫秒,默认为0</pre>
        </li>
    </ul>

    <h3>Returns:</h3>
    <ul>
        <li>
        <pre class="example">string,string,返回 response_code, response_message</pre></il>
    </ul>




</dd>
</dl>
    <h2 class="section-header "><a name="Fields"></a>Fields</h2>

    <dl class="function">
    <dt>
    <a name = "ftp_data_client"></a>
    <strong  style="color: red;">
    ftp_data_client
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">创建ftp数据连接</pre>







</dd>
    <dt>
    <a name = "ftp_client"></a>
    <strong  style="color: red;">
    ftp_client
    </strong>
    </dt>
    <dd>
    <pre class="example"  style="color: red;">创建ftp命令连接</pre>







</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
<i style="float:right;">Last updated 2021-08-02 13:53:19 </i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

